package util;

import com.github.wxpay.sdk.WXPayConfig;
import java.io.*;

public class WXConfig implements WXPayConfig{

    private byte[] certData;

    public WXConfig()  {
        //String certPath = "F:\\cert\\apiclient_cert.p12";
    	String certPath = "/home/LeStudio/cert/apiclient_cert.p12";
        File file = new File(certPath);
        try {
        	InputStream certStream = new FileInputStream(file);
            this.certData = new byte[(int) file.length()];
            certStream.read(this.certData);
            certStream.close();
			
		} catch (Exception e) {
			e.printStackTrace();
		}
        
    }

    public String getAppID() {
        return "wxb1b8e993084028e9";
    }

    public String getMchID() {
        return "1492781032";
    }

    public String getKey() {
        return "ly123456789012345678901234567890";
    }

    public InputStream getCertStream() {
        ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
        return certBis;
    }

    public int getHttpConnectTimeoutMs() {
        return 8000;
    }

    public int getHttpReadTimeoutMs() {
        return 10000;
    }
}
